NAVNavbar
Logo
php python csharp java

Keyword Suggestions

‌‌
The Keyword Suggestions endpoint provides search queries that include the specified seed keyword.

The algorithm is based on the full-text search for the specified keyword and therefore returns only those search terms that contain the keyword you set in the POST array with additional words before, after, or within the specified key phrase. Returned keyword suggestions can contain the words from the specified key phrase in a sequence different from the one you specify.

As a result, you will get a list of long-tail keywords with each keyword in the list matching the specified search term.

Along with each suggested keyword, you will get its search volume rate for the last month, search volume trend for the previous 12 months, as well as current cost-per-click and competition values. Moreover, this endpoint supplies minimum, maximum and average values of daily impressions, clicks and CPC for each result.

Datasource: DataForSEO Keyword Database
Search algorithm: full-text search for terms that match the specified seed keyword with additional words included before, after, or within the seed key phrase.
Examples
Specified seed keyword:
“keyword research”
Resulting suggestions:
•”google research keyword”,
•”how to do keyword research”,
•”keyword competitor research”,
•”how to do keyword research for content marketing”

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard

<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
$client = new RestClient($api_url, null, 'login', 'password');

$post_array = array();
// simple way to set a task
$post_array[] = array(
   "keyword" => "phone",
   "language_name" => "English",
   "location_code" => 2840,
   "filters" => [
      ["impressions_info.ad_position_average", ">", 1],
      "and",
      [
         ["impressions_info.cpc_max", "<", 0.5],
         "or",
         ["impressions_info.daily_clicks_max", ">=", 10]
      ]
   ]
);
try {
   // POST /v3/dataforseo_labs/keyword_suggestions/live
   $result = $client->post('/v3/dataforseo_labs/keyword_suggestions/live', $post_array);
   print_r($result);
   // do something with post result
} catch (RestClientException $e) {
   echo "\n";
   print "HTTP code: {$e->getHttpCode()}\n";
   print "Error code: {$e->getCode()}\n";
   print "Message: {$e->getMessage()}\n";
   print  $e->getTraceAsString();
   echo "\n";
}
$client = null;
?>

The above command returns JSON structured like this:

{
  "version": "0.1.20200312",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.6323 sec.",
  "cost": 0.01,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "03121707-0696-0125-0000-abf70f234a21",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.3434 sec.",
      "cost": 0.01,
      "result_count": 1,
      "path": [
        "v3",
        "dataforseo_labs",
        "keyword_suggestions",
        "live"
      ],
      "data": {
        "api": "dataforseo_labs",
        "function": "keyword_suggestions",
        "keyword": "phone",
        "language_name": "English",
        "location_code": 2840,
        "filters": [
          [
            "impressions_info.ad_position_average",
            ">",
            1
          ],
          "and",
          [
            [
              "impressions_info.cpc_max",
              "<",
              0.5
            ],
            "or",
            [
              "impressions_info.daily_clicks_max",
              ">=",
              10
            ]
          ]
        ],
        "limit": 5
      },
      "result": [
        {
          "seed_keyword": "phone",
          "location_code": 2840,
          "language_code": "en",
          "total_count": 2432,
          "items_count": 5,
          "items": [
            {
              "keyword": "reverse lookup phone",
              "location_code": 2840,
              "language_code": "en",
              "keyword_info": {
                "last_updated_time": "2020-03-02T04:08:52",
                "competition": 0.41743000023420324,
                "cpc": 0.767953,
                "search_volume": 823000,
                "categories": [
                  10007,
                  10108,
                  10756,
                  11495,
                  11498,
                  13418,
                  13449,
                  13710
                ],
                "monthly_searches": [
                  {
                    "year": 2020,
                    "month": 1,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 12,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 11,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 10,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 9,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 8,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 7,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 6,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 5,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 4,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 3,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 2,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 1,
                    "search_volume": 1000000
                  }
                ]
              },
              "impressions_info": {
                "last_updated_time": "2020-03-01T20:09:46",
                "bid": 999,
                "match_type": "exact",
                "ad_position_min": 1.11,
                "ad_position_max": 1,
                "ad_position_average": 1.06,
                "cpc_min": 1.11,
                "cpc_max": 1.36,
                "cpc_average": 1.24,
                "daily_impressions_min": 1702.05,
                "daily_impressions_max": 2080.29,
                "daily_impressions_average": 1891.17,
                "daily_clicks_min": 129.95,
                "daily_clicks_max": 158.83,
                "daily_clicks_average": 144.39,
                "daily_cost_min": 160.62,
                "daily_cost_max": 196.31,
                "daily_cost_average": 178.47
              }
            },
            {
              "keyword": "find my [< phone",
              "location_code": 2840,
              "language_code": "en",
              "keyword_info": {
                "last_updated_time": "2020-02-28T21:49:15",
                "competition": 0.11678797854897263,
                "cpc": 1.144622,
                "search_volume": 673000,
                "categories": [
                  10007,
                  10019,
                  10108,
                  10167,
                  10168,
                  10756,
                  10878,
                  10885,
                  11495,
                  12161,
                  13378,
                  13381,
                  13418,
                  13449
                ],
                "monthly_searches": [
                  {
                    "year": 2020,
                    "month": 1,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 12,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 11,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 10,
                    "search_volume": 823000
                  },
                  {
                    "year": 2019,
                    "month": 9,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 8,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 7,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 6,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 5,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 4,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 3,
                    "search_volume": 673000
                  },
                  {
                    "year": 2019,
                    "month": 2,
                    "search_volume": 550000
                  },
                  {
                    "year": 2019,
                    "month": 1,
                    "search_volume": 673000
                  }
                ]
              },
              "impressions_info": {
                "last_updated_time": "2020-02-28T22:20:15",
                "bid": 999,
                "match_type": "exact",
                "ad_position_min": 1.11,
                "ad_position_max": 1,
                "ad_position_average": 1.06,
                "cpc_min": 26.42,
                "cpc_max": 32.3,
                "cpc_average": 29.36,
                "daily_impressions_min": 3139.94,
                "daily_impressions_max": 3837.7,
                "daily_impressions_average": 3488.82,
                "daily_clicks_min": 240.45,
                "daily_clicks_max": 293.88,
                "daily_clicks_average": 267.17,
                "daily_cost_min": 7059.63,
                "daily_cost_max": 8628.43,
                "daily_cost_average": 7844.03
              }
            }
          ]
        }
      ]
    }
  ]
}

All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. You can send up to 2000 API calls per minute.

You can specify the number of results you want to retrieve, filter and sort them.

Below you will find a detailed description of the fields you can use for setting a task.

Description of the fields for setting a task:

Field name Type Description
keyword string keyword
required field
UTF-8 encoding
a keyword should be at least 3 characters long;
the keywords will be converted to lowercase format
location_name string full name of the location
optional field
if you use this field, you don’t need to specify location_code
you can receive the list of available locations with their location_name by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
ignore this field to get the results for all available locations
example:
United Kingdom
location_code integer location code
optional field
if you use this field, you don’t need to specify location_name
you can receive the list of available locations with their location_code by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
ignore this field to get the results for all available locations
example:
2840
language_name string full name of the language
optional field
if you use this field, you don’t need to specify language_code
you can receive the list of available languages with their language_name by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
ignore this field to get the results for all available languages
example:
English
language_code string language code
optional field
if you use this field, you don’t need to specify language_name
you can receive the list of available languages with their language_code by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
ignore this field to get the results for all available languages
example:
en
filters array array of results filtering parameters
optional field
you can add several filters at once (8 filters maximum)
you should set a logical operator and, or between the conditions
the following operators are supported:
<, <=, >, >=, =, <>, in, not_in, like, not_like
you can use the % operator with like and not_like to match any string of zero or more characters
example:
["keyword_info.search_volume",">",0]

[["impressions_info.daily_impressions_average","in",[0,1000]],
"and",
["impressions_info.ad_position_average","=",1]]

[["impressions_info.ad_position_average",">",1],
"and",
[["impressions_info.cpc_max","<",0.5],"or",["impressions_info.daily_clicks_max",">=",10]]]

for more information about filters, please refer to Dataforseo Labs – Filters

order_by array results sorting rules
optional field
you can use the same values as in the filters array to sort the results
possible sorting types:
asc – results will be sorted in the ascending order
desc – results will be sorted in the descending order
a comma is used as a separator
example:
["keyword_info.competition,desc"]
default rule:
["keyword_info.search_volume,desc"]
note that you can set no more than three sorting rules in a single request
you should use a comma to separate several sorting rules
example:
["keyword_info.search_volume,desc","keyword_info.cpc,desc"]
limit integer the maximum number of returned keywords
optional field
default value: 100
maximum value: 1000
offset integer offset in the results array of returned keywords
optional field
default value: 0
if you specify the 10 value, the first ten keywords in the results array will be omitted and the data will be provided for the successive keywords
tag string user-defined task identifier
optional field
the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specified tag value in the data array of the response

As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

Description of the fields in the results array:

Field name Type Description
version string the current version of the API
status_code integer general status code
you can find the full list of the response codes here
status_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array returned with an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
        result_count integer number of elements in the result array
        path array URL path
        data array contains the same parameters that you specified in the POST request
        result array array of results
            seed_keyword string keyword in a POST array
            location_code integer location code in a POST array
if there is no data, then the value is null
            language_code string language code in a POST array
if there is no data, then the value is null
            total_count integer total amount of results in our database relevant to your request
            items_count integer the number of results returned in the items array
            items array contains keywords and related data
                    keyword string keyword suggestion
                    location_code integer location code in a POST array
                    language_code string language code in a POST array
                    keyword_info array keyword data for the returned keyword
                        last_updated_time string date and time when keyword data was updated
in the format: “year-month-date:minutes:UTC_difference_hours:UTC_difference_minutes”
example:
2019-11-15 12:57:46 +00:00
                        competition float competition
represents the relative amount of competition associated with the given keyword
this value is based on Google Ads data and can be between 0 and 1 (inclusive)
                        cpc float cost-per-click
represents the average cost per click (USD) historically paid for the keyword
                        search_volume integer average monthly search volume rate
represents either the (approximate) number of searches for the given keyword idea on google.com
                        categories array product and service categories
you can download the full list of possible categories
                        monthly_searches array monthly searches
represents the (approximate) number of searches for this keyword idea (as available for the past twelve months), targeted to the specified geographic locations
                            year integer year
                            month integer month
                            search_volume integer monthly average search volume rate
                    impressions_info array impressions data for the returned keyword idea
                        last_updated_time string date and time when impressions data was updated
in the format: “year-month-date:minutes:UTC_difference_hours:UTC_difference_minutes”
example:
2019-11-15 12:57:46 +00:00
                        bid integer the maximum bid
it stands for the price you are willing to pay for an ad
the higher the value, the higher positions and price you will get
we return the results for the 999 bid value to provide the most relevant impressions data
                        match string keyword match-type
can take the following values: exact, broad, phrase
                        ad_position_min float the minimum ad position
represents the minimum position of the advertisement
                        ad_position_max float the maximum ad position
represents the maximum position of the advertisement
                        ad_position_average float the average ad position
represents the average position of the advertisement
                        cpc_min float the minimum value of cost-per-click
represents the minimum cost-per-click (USD) historically paid for the keyword
                        cpc_max float the maximum value of cost-per-click
represents the maximum cost-per-click (USD) historically paid for the keyword
                        cpc_average float the average value of cost-per-click
represents the average cost-per-click (USD) historically paid for the keyword
                        daily_impressions_min float the minimum value of daily impressions
represents the minimum number of daily impressions of the advertisement
                        daily_impressions_max float the maximum value of daily impressions
represents the maximum number of daily impressions of the advertisement
                        daily_impressions_average float the average value of daily impressions
represents the average number number of daily impressions of the advertisement
                        daily_clicks_min float the minimum value of daily clicks
represents the minimum number of daily clicks on the advertisement
                        daily_clicks_max float the maximum value of daily clicks
represents the maximum number of daily clicks on the advertisement
                        daily_clicks_average float the average value of daily clicks
represents the average number of daily clicks on the advertisement
                        daily_cost_min float the minimum daily charge value
represents the minimum daily cost of the advertisement
                        daily_cost_max float the maximum daily charge value
represents the maximum daily cost of the advertisement
                        daily_cost_average float the average daily charge value
represents the average daily cost of the advertisement

‌‌